const path = require('path')
const webpack = require('webpack')

module.exports = {
  mode: 'production',
  entry: {
    vendor: ['react', 'react-dom', 'react-router', 'react-router-dom']
  },
  output: {
    filename: '_dll_[name].js', //产生的文件名
    path: path.resolve(__dirname, '../dist'),
    library: '_dll_[name]',
    libraryTarget: 'var'
  },
  plugins: [
    new webpack.DllPlugin({
      name: '_dll_[name]', //name要和llibrary对应
      path: path.resolve(__dirname, '../public/dll', 'mainfest.json')
    })
  ]
}
